export const dynamic = "force-dynamic"; import { notFound } from "next/navigation"; import { auth } from "@clerk/nextjs/server"; import { fetchTemplates, createCheckoutSession } from "@/vendor/carrier/client"; import { CheckoutClient } from "./CheckoutClient"; export const metadata = { title: "Checkout" }; interface Props { params: Promise<{ templateId: string }>; } export default async function CheckoutPage({ params }: Props) { const { templateId } = await params; const { userId } = await auth(); const plans = await fetchTemplates(); const plan = plans.find((p) => p.id === templateId); if (!plan) notFound(); const session = userId ? await createCheckoutSession(templateId, userId) : null; return ; }